package com.ym521.emojipack.keyboard.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import java.util.List;

/**
 * @author Ym
 * E-mail: 2435970206@qq.com
 * createTime:2023/7/9
 * explain:
 */
public final class EmojiPackFragmentPagerAdapter extends FragmentStateAdapter {

    private List<Fragment> fragments;

    public EmojiPackFragmentPagerAdapter(@NonNull Fragment fragment, List<Fragment> fragments) {
        super(fragment);
        this.fragments = fragments;
    }


    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return fragments.get(position);
    }

    @Override
    public int getItemCount() {
        return fragments.size();
    }
}
